﻿namespace WeDonekRpc.SqlSugar.VirtualQuery
{
    public class QueryStruct
    {
        /// <summary>
        /// 表名
        /// </summary>
        public TableStruct Table { get; set; }

        /// <summary>
        /// 查询条件
        /// </summary>
        public IWhereCol[] Where { get; set; }

        /// <summary>
        /// 返回结构
        /// </summary>
        public SelectStruct[] Select { get; set; }

        public HavingCol? Having { get; set; }

        /// <summary>
        /// 分组
        /// </summary>
        public GroupByStruct[] GroupBy { get; set; }

        public OrderByStruct[] OrderBy { get; set; }
        public QueryStruct Clone ()
        {
            QueryStruct t = new QueryStruct
            {
                Table = this.Table,
                GroupBy = this.GroupBy,
                Select = this.Select,
                OrderBy = this.OrderBy
            };
            return t;
        }

    }
}
